using Triggers;
using UnityEngine;

public class PerformanceTrigger : MonoBehaviour
{
    private Trigger<Player> trigger;

    [SerializeField]
    private Performance performance;

    private void Awake()
    {
        trigger = GetComponent<Trigger<Player>>();
        trigger.OnTriggerEnter += MyOnTriggerEnter;
    }

    private void MyOnTriggerEnter(Player _)
    {
        if (performance != null)
        {
            performance.enabled = true;
            performance.Play();
        }
    }
}
